import request from '@/utils/request'
const apix = 'dev-api'
// api地址
const api = {
	vouchers_exchange: apix + '/integral/vouchers/exchange',
	integral_vouchers: apix + '/integral/vouchers',
	vouchers_businessWriteOff: apix + '/integral/vouchers/businessWriteOff',
	volumeWriteOff: apix + '/welfare/volume/writeOff',
	welfareVolume: apix + '/welfare/volume/',

}
//商品核销
export function businessWriteOff(obj) {
	return request.post(api.vouchers_businessWriteOff, {
		...obj
	})
}
export function welfareVolume(voucherId, userId) {
	return request.get(api.welfareVolume + voucherId)
}
//商品核销
export function volumeWriteOff(volumeId, userId, writeOffRemark) {
	return request.post(api.volumeWriteOff, {
		volumeId,
		userId,
		writeOffRemark
	})
}

//兑换商品接口
export function vouchersexchange(commodityId, volumeUserInfo) {
	return request.post(api.vouchers_exchange, {
		commodityId,
		volumeUserInfo
	})
}